package com.qf.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;

/**
 * 用户表(User)表数据库访问层
 *
 * @author makejava
 * @since 2024-11-08 12:06:19
 */
@Mapper
public interface UserDao extends BaseMapper<User> {

    @Select("select * from t_user where phone =#{phone}")
    User selectByPhone (String phone);

    @Update("update t_user set token=#{token} , logon_time=#{logonTime} where phone=#{phone} ")
    int updateByPhone (String phone, String token , Date logonTime);

    @Select("select * from t_user where token =#{token}")
    User selectByToken(String token);

}

